<div class="row">
    <p id="list-title">{{.PageName}}</p>
</div>

<form id="sequenceForm" action="{{.URL}}{{.RecordID}}?action={{.Action}}" method="post" class="post-form form-horizontal {{if .Readonly}}form-disabled{{else}}form-edit{{end}}" role="form">
    <div class="row title-action">
        {{if .RecordID}} {{if .Readonly}}
        <a href="{{.URL}}{{.RecordID}}?action=edit" class="btn btn-success fa fa-pencil pull-left form-edit-btn">&nbsp编辑</a>
        <a href="{{.URL}}?action=create" type="buttom" class="btn btn-success fa fa-plus pull-left form-create-btn">&nbsp新建</a>{{end}} {{end}}
        <button type="submit" form="sequenceForm" class="btn btn-primary fa fa-save pull-left form-save-btn">&nbsp保存</button>
        <a href="{{.URL}}{{if .RecordID}}{{.RecordID}}?action=detail{{end}}" class="btn btn-danger fa fa-remove  pull-left form-cancel-btn">&nbsp取消</a>
        <a href="{{.URL}}" class="btn btn-info fa fa-list pull-left">&nbsp列表</a>
    </div>
    {{ .xsrf }} {{if .RecordID}}
    <input type="hidden" data-type="int" name="recordID" id="record-id" class="{{.FormField}}" value="{{.RecordID}}"> {{end}}
    <fieldset>
        <legend>基本信息</legend>
        <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                    <label for="name" class="col-md-4 control-label label-start">序列名称<span class="required-input">&nbsp*</span></label>
                    <div class="col-md-8">
                        <p class="p-form-control">{{if .Sequence}} {{.Sequence.Name}} {{end}}</p>
                        <input data-type="string" class="form-control {{.FormField}}" name="Name" type="text" {{if not .Readonly}}autofocus{{end}}{{if .Sequence}} value="{{.Sequence.Name}}" {{end}} />
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="code" class="col-md-4 control-label label-start">序列前缀<span class="required-input">&nbsp*</span></label>
                    <div class="col-md-8">
                        <p class="p-form-control">{{if .Sequence}} {{.Sequence.Prefix}} {{end}}</p>
                        <input data-type="string" class="form-control {{.FormField}} " name="Prefix" type="text" {{if .Sequence}} value="{{.Sequence.Prefix}}" {{end}} />
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="sequence" class="col-md-4 control-label label-start">表struct名称<span class="required-input">&nbsp*</span></label>
                    <div class="col-md-8">
                        <p class="p-form-control">{{if .Sequence}} {{.Sequence.StructName}} {{end}}</p>
                        <input data-type="string" class="form-control {{.FormField}}" name="StructName" type="text" {{if .Sequence}} value="{{.Sequence.StructName}}" {{end}} />
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="sequence" class="col-md-4 control-label label-start">序列位数<span  >&nbsp</span></label>
                    <div class="col-md-8">
                        <p class="p-form-control">{{if .Sequence}} {{.Sequence.Padding}} {{end}}</p>
                        <input data-type="int" class="form-control {{.FormField}}" name="Padding" type="text" {{if .Sequence}} value="{{.Sequence.Padding}}" {{else}}value="8" {{end}} />
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                    <label for="active" class="col-md-4 control-label ">有效</label>
                    <div class="col-md-8 ">
                        <input data-type="bool" name="Active" data-oldvalue="{{.SequenceActive}}" id="active" class="form-control form-checkbox {{.FormField}}" {{if and .Sequence .SequenceActive}}{{if eq .SequenceActive true}}checked="checked" {{end}} {{else}}checked="checked"
                            {{end}}type="checkbox">
                    </div>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="IsDefault" class="col-md-4 control-label ">为默认</label>
                    <div class="col-md-8 ">
                        <input data-type="bool" name="IsDefault" data-oldvalue="{{.SequenceIsDefault}}" id="IsDefault" class="form-control form-checkbox {{.FormField}}" {{if and .Sequence .SequenceIsDefault}}{{if eq .SequenceIsDefault true}}checked="checked" {{end}} {{else}}checked="checked"
                            {{end}} type="checkbox">
                    </div>
                </div>
            </div>
        </div>
    </fieldset>

</form>